<#
 #   It is recommended to test the script on a local machine for its purpose and effects. 
 #   ManageEngine Endpoint Central will not be responsible for any 
 #   damage/loss to the data/setup based on the behavior of the script.

 #   Description: Script is designed To Enable the Network Connectivity while in Modern Standby On Battery & Plugged in
 #   Configuration Type - COMPUTER
 #   Refer: https://www.elevenforum.com/t/enable-or-disable-network-connectivity-in-modern-standby-in-windows-11.3286/
 #   Note:  If the registry changes but is not reflected, the customer should check with Windows support for assistance.
 #>


# Set the registry values for ACSettingIndex and DCSettingIndex

$registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9"

# Set ACSettingIndex to 1 (00000001)
Set-ItemProperty -Path $registryPath -Name "ACSettingIndex" -Value 1

# Set DCSettingIndex to 1 (00000001)
Set-ItemProperty -Path $registryPath -Name "DCSettingIndex" -Value 1

Write-Host "Always_Enable_Modern_Standby_network_connectivity set successfully"